@extends('Admin.layouts.common')

@section('content')
    <div class="myContainer">
        <div class="col-xs-12 col-sm-6">
            <div class="panel panel-deep-primary">
                <div class="panel-heading">统计<button class="close panel_close_btn"><i class="glyphicon glyphicon-chevron-down"></i></button></div>
                <div class="panel-body" id="stat">
                    <p class="text-center"><i class="loadingSVG-dark"></i></p>
                  
                </div>
            </div>
        </div>
        <div class="col-xs-12 col-sm-6">
            <div class="panel panel-dark">
                <div class="panel-heading">最新注册用户<button class="close panel_close_btn"><i class="glyphicon glyphicon-chevron-down"></i></button></div>
                <div class="panel-body" id="new_user">
                    <p class="text-center"><i class="loadingSVG-dark"></i></p>
                </div>
            </div>
        </div>
        {{-- <div class="col-xs-12 col-sm-6">
            <div class="panel panel-green">
                <div class="panel-heading">标题<button class="close panel_close_btn"><i class="glyphicon glyphicon-chevron-down"></i></button></div>
                <div class="panel-body">
                    <p class="text-center"><i class="loadingSVG-dark"></i></p>
                </div>
            </div>
        </div> --}}
    </div>
@endsection

@section('foot')
<!-- <script>
    $.ajax({
        url: '/Home/ajax_stat',
        dataType: 'json',
        type: 'post',
        success: function (d) {
            if(!d.status){ post(3, '统计数据获取失败');return false; }
            var html = '<div class="col-xs-12 col-sm-6">';
            html += '<p>用户数：'+d.data.user_count+'</p>';
            html += '<p>投资用户：'+d.data.invested_user_count+'</p>';
            html += '<p>今日注册：'+d.data.today_user_count+'</p>';
            html += '<p>今日充值：'+d.data.today_recharge+'</p>';
            html += '<p>今日提现：'+d.data.today_withdraw+'</p>';
            html += '<p>今日投资：'+d.data.today_invest+'</p>';
            html += '<p>今日回款：'+d.data.today_repay+'</p>';
            html += '</div>';

            html += '<div class="col-xs-12 col-sm-6">';
            html += '<p>零钱可投金额：'+d.data.piggy_remain+'</p>';
            html += '<p>零钱本金到期等待续投的总额：'+d.data.piggy_expire_capital+'</p>';
            html += '<p>零钱利息等待复投的金额：'+d.data.borrow_piggy_repay+'</p>';
            html += '<p>零钱新手预约金额：'+d.data.piggy_queue+'</p>';
            html += '</div>';
            $('#stat').html(html);
        }
    });
    $.ajax({
        url: '/Home/ajax_new_user',
        dataType: 'json',
        type: 'post',
        success: function (d) {
            if(!d.status){ post(3, '最新注册用户获取失败');return false; }
            var html = '<table class="table"><thead><tr><th>手机号</th><th>注册时间</th><th>注册渠道</th><th>注册IP</th></tr></thead><tbody>';
            for(var i = 0; i < d.data.length; i++){
                html += '<tr>';
                html += '<td>'+d.data[i].user_phone+'</td>';
                html += '<td>'+d.data[i].reg_time+'</td>';
                html += '<td>'+d.data[i].reg_channel+'</td>';
                html += '<td>'+d.data[i].reg_ip+'</td>';
                html += '</tr>';
            }
            html += '</tbody></table>';
            $('#new_user').html(html);
        }
    });
</script> -->
@endsection